<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    //方式1
    var arr = new Array(1, 2, 3);
    //alert(arr);
    //方式二
    var arr2 = [1, 2, 3];
    //alert(arr2);

    //访问
    arr2[0]=10;
    //alert(arr2);

    arr3 = [1, 2, 3];
    arr3[10] = 10;
    //alert(arr3);

    arr3[5] = "hello world";
    // alert(arr3);

    var arr4 = [1, 2, 3, 4];
    /*for (let i = 0; i <arr4.length; i++) {
        alert(arr4[i]);
    }*/

    var arr5 = [1, 2, 3, 4];
    arr5.push(10);
    //alert(arr5)

    arr5.splice(0, 1);
    alert(arr5)
</script>

</body>
</html>